import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CarIconVO, CarIconForm, CarIconQuery } from '@/api/bzIns/carIcon/types';

/**
 * 查询汽车图标列表
 * @param query
 * @returns {*}
 */

export const listCarIcon = (query?: CarIconQuery): AxiosPromise<CarIconVO[]> => {
  return request({
    url: '/bzIns/carIcon/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询汽车图标详细
 * @param carIconId
 */
export const getCarIcon = (carIconId: string | number): AxiosPromise<CarIconVO> => {
  return request({
    url: '/bzIns/carIcon/' + carIconId,
    method: 'get'
  });
};

/**
 * 新增汽车图标
 * @param data
 */
export const addCarIcon = (data: CarIconForm) => {
  return request({
    url: '/bzIns/carIcon',
    method: 'post',
    data: data
  });
};

/**
 * 修改汽车图标
 * @param data
 */
export const updateCarIcon = (data: CarIconForm) => {
  return request({
    url: '/bzIns/carIcon',
    method: 'put',
    data: data
  });
};

/**
 * 删除汽车图标
 * @param carIconId
 */
export const delCarIcon = (carIconId: string | number | Array<string | number>) => {
  return request({
    url: '/bzIns/carIcon/' + carIconId,
    method: 'delete'
  });
};
